package com.ruiyian.common.core.domain.entity;

import com.ruiyian.common.annotation.Excel;
import com.ruiyian.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @author chong
 * @email 673426164@qq.com
 * @create 2021/7/15
 * Desc: 点位信息
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Point extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private Long id;
    @Excel(name = "memoryArea")
    private Integer memoryArea;
    @Excel(name = "registerAddress")
    private String registerAddress;
    @Excel(name = "length")
    private Integer length;
    @Excel(name = "code")
    private String code;
    @Excel(name = "eqId")
    private Long eqId;
    @Excel(name = "tunnel_id")
    private Long tunnelId;
    private String name;
    private String tunnelName;
    @Excel(name = "status")
    private Integer status; //1仅读,2读写,3仅写
    @Excel(name = "encoding")
    private String encoding;
    @Excel(name = "value")
    private String value;
    @Excel(name = "if_plan")
    private String ifPlan;
    private String direction;
    private Long direId;
    @Excel(name = "holeId")
    private Long holeId;
    private String holeName;
    private String typeName;
    private String pilenum;
    private String propertyCode;
    private Long moduleId;
    private String moduleName;
    @Excel(name = "serverId")
    private Long serverId;
    private String serverPath;  // 服务:端口 拼接
    @Excel(name = "bits")
    private Integer bits;  // 位操作位置
    @Excel(name = "type")
    private String type; // 0字操作,1位操作
    @Excel(name = "groupNum")
    private Integer groupNum;
    // 0页面读取1:定时读取
    @Excel(name = "flag")
    private Integer flag;

    public Point(Long tunnelId, Long moduleId, Integer memoryArea, String registerAddress){
        this.tunnelId = tunnelId;
        this.moduleId = moduleId;
        this.memoryArea = memoryArea;
        this.registerAddress = registerAddress;
    }
//    private Long equipmentId;
    public Point(Integer memoryArea, String registerAddress, Integer length, String code) {
        this.memoryArea = memoryArea;
        this.registerAddress = registerAddress;
        this.length = length;
        this.code = code;
    }
    public Point(Long tunnelId, Long holeId, Long moduleId,Integer groupNum,Long eqId) {
        this.tunnelId = tunnelId;
        this.holeId = holeId;
        this.moduleId = moduleId;
        this.groupNum = groupNum;
        this.eqId = eqId;
    }
    public Point(Long tunnelId, Long holeId, Long moduleId,Integer groupNum) {
        this.tunnelId = tunnelId;
        this.holeId = holeId;
        this.moduleId = moduleId;
        this.groupNum = groupNum;
    }
    public Point(Long tunnelId, Long holeId, Long moduleId,Integer groupNum,Integer flag) {
        this.tunnelId = tunnelId;
        this.holeId = holeId;
        this.moduleId = moduleId;
        this.groupNum = groupNum;
        this.flag = flag;
    }
    public Point(Long tunnelId, Long holeId, Long moduleId,Integer groupNum,Integer flag,Long equipmentId) {
        this.tunnelId = tunnelId;
        this.holeId = holeId;
        this.moduleId = moduleId;
        this.groupNum = groupNum;
        this.flag = flag;
//        this.equipmentId = equipmentId;
    }
    public Point(Long tunnelId, Long holeId, Long moduleId) {
        this.tunnelId = tunnelId;
        this.holeId = holeId;
        this.moduleId = moduleId;
    }
    public Point(Long id, String value) {
        this.id = id;
        this.value = value;
    }
    public Point(Long id, String value, Long eqId, String code,Integer groupNum) {
        this.id = id;
        this.value = value;
        this.eqId = eqId;
        this.code = code;
        this.groupNum = groupNum;
    }

    public Point(Long id, String value, Long tunnelId, String code) {
        this.id = id;
        this.value = value;
        this.tunnelId = tunnelId;
        this.code = code;
    }
    public Point(Integer groupNum,Integer flag) {
        this.groupNum = groupNum;
        this.flag = flag;
    }
}
